<!doctype html>

<html>

<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  <meta charset="utf-8"/>

  <title><%= content_for?(:title) ? yield(:title) : "Lark" %></title>

  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

  <%= csrf_meta_tags %>

  <%= stylesheet_link_tag "rediscss/sessionindex.css"%>
  <%= javascript_include_tag "registjs/jquery-1.10.2.min.js" %>
  <%= javascript_include_tag "registjs/jquery.form" %>

</head>
<body>
<div class="main">
  <div class="main_top">
    <div class="logo"><%= image_tag("logo_32.png") %></div>
    <div class="main_out">信息登记系统</div>
    <div class="main_txt">欢迎登录</div>
    <%= link_to "登录","/" %>
  </div>

  <div id="con">
    <%= form_tag users_sessions_fix_password_path,class:"bl-form bl-formhor",:id=>"new_user" do |f| %>
        <input type="hidden" , name="setpassword" , value="true">
        <input type="hidden" , name="check_mobile" , value="true">
        <div class="con_grou clearfix">
          <label for="telphone" class="label  one" ></label>
          <div class="frm_control">
          </div>   <!--frm_controls-->
        </div>     <!--frm_control_group-->
        <!--手机号-->
        <div class="con_grou clearfix">
          <label for="telphone" class="label one">车辆销售管理系统帐号：&nbsp;</label>
          <div class="frm_control">
            <input type="text" class="input required" id="telphone" name="user[mobile]" value placeholder="账号应该是手机号" required data-rule-mobile="true" data-msg-required="请输入手机号" data-msg-mobile="请输入正确格式">
          </div>   <!--frm_controls-->
        </div>     <!--frm_control_group-->
        <!--短信验证码-->
        <div class="con_grou clearfix">
          <label for="" class="label  one">验证码：&nbsp;</label>
          <div class="frm_control">
            <input name="_rucaptcha" autocomplete="off" type="text" id="input2"  placeholder="必填"><a class="rucaptcha-image-box" href="#"><img alt="Captcha" class="rucaptcha-image" src="/rucaptcha/"></a>
            <span class="error" style="float: left;margin: 0px"><%= flash[:rucaptcha_error] %></span>
          </div>    <!--frm_controls-->
        </div>     <!--frm_control_group-->
        <!--验证码-->
        <div class="frm_control clearfix">
          <input class="submit button01" type="submit" value="接收短信验证码"/>
        </div>    <!--frm_controls-->
    <% end %>
  </div>


  <footer>北京九酷网络科技有限公司</footer>
</div>
</body>
<script>
    $(function(){
        $("#new_user").validate({
            submitHandler: function() {
                form.submit();
          }
        });
        $(".rucaptcha-image-box").click(function(e){
            btn = $(e.currentTarget)
            img = btn.find('img:first')
            currentSrc = img.attr('src');
            img.attr('src', currentSrc.split('?')[0] + '?' + (new Date()).getTime())
            return false
        });
    })

    $.validator.setDefaults({
        errorElement:'span'
    });

    //配置通用的默认提示语
    $.extend($.validator.messages, {
        required: '必填',
        equalTo: "请再次输入相同的值"
    });
    //手机验证规则
    jQuery.validator.addMethod("mobile", function (value, element) {
        var mobile = /^1[3|4|5|7|8]\d{9}$/;
        return this.optional(element) || (mobile.test(value));
    }, "手机格式不对");

</script>



</html>